package com.shisfish.library.Exe;

import java.util.Timer;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.shisfish.library.Timing.IsBespeak;

public class IsBespeakExe implements ServletContextListener{

	Timer timer = null;
	
	public static final int HALF_DAY = 12*60*60*1000;
	
	public static final int SIX_HOURS = 6*60*60*1000;
	
	public static final int ONE_MINUTES = 60*1000;

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		// TODO Auto-generated method stub
		timer = new Timer(true); 
        timer.schedule(new IsBespeak(), 0, SIX_HOURS);  //6个小时运行一次
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		// TODO Auto-generated method stub
		timer.cancel(); 
	}
	
}
